/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * <p>Project: app2022 - RegExp4
 * <p>Powered by webrx On 2022-01-13 16:47:28
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class RegExp4 {
    public static void main(String[] args) {
        //正则表达式，贪婪模式（默认），禁用贪婪是题词后+？
        String str = """
				<div>hellojava</div><div>java 15</div><div><p>java 15</p><span>java 8</p><div>java 15</div></div>
				""";

        //select("div[class=xxx]")
        Pattern p = Pattern.compile("<div>([ a-z0-9]*?java[ a-z0-9]*?)</div>");
        Matcher m = p.matcher(str);
        while(m.find()) {
            System.out.println(m.group(1));
        }
    }
}
